package com.wtwd.campus.jdzc.dao;

import com.wtwd.campus.jdzc.entity.JdzcUserStudentPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * @author mjy
 * @date 2022/02/15
 * @description
 */
@Mapper
public interface JdzcUserStudentPermissionMapper {

    /**
     * 查询学生和微信用户的关系
     * @param studentId
     * @param userId
     * @return
     */
    JdzcUserStudentPermission getWxUserStudentPermissionByCondition(@Param("studentId") Integer studentId, @Param("userId") Integer userId);

    /**
     * 添加学生和微信用户的绑定关系
     * @param studentId
     * @param userId
     * @return
     */
    int addWxUserStudentPermission(@Param("phone") String phone,@Param("studentId") Integer studentId, @Param("userId") Integer userId,@Param("isMan") Integer isMan,@Param("isAuthority") Integer isAuthority);


    int delWxUserStudentPermission(@Param("studentId") Integer studentId, @Param("userId") Integer userId);

    Map<String,Object> getBindingById(@Param("id") Integer id);

    /**
     * 设置管理员
     * @param userId
     * @param isMan
     * @return
     */
    Integer changeManager(@Param("userId") Integer userId,@Param("isMan") Integer isMan,@Param("stuId") Integer stuId,@Param("isAuthority") Integer isAuthority);

    /**
     * 授权
     * @param id
     * @return
     */
    Integer giveAuthority(@Param("id") Integer id,@Param("status") Integer status);

    Map<String, Object> getSchoolIdAndClassIdByStuId(Integer stuId);

    Map<String, Object> getBindingByStuIdAndUserId(@Param("stuId") Integer stuId,@Param("userId") Integer userId);
}
